home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kwin.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-14  |  25.4 KB  |  722 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 1999 Matthias Ettrich (ettrich@kde.org)
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.     Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef KWIN_H
  20. #define KWIN_H
  21.  
  22. #include <sys/types.h>
  23. #include <qwindowdefs.h>
  24. #include <qstring.h>
  25. #include <qpixmap.h>
  26. #include "kdelibs_export.h"
  27.  
  28. #ifdef Q_OS_UNIX
  29.  
  30. #include <netwm_def.h>
  31. class NETWinInfo;
  32.  
  33. /**
  34.  * Convenience access to certain properties and features of the
  35.  * window manager.
  36.  *
  37.  * This class is not supposed to be instantiated.  It exists mostly as
  38.  * a namespace for the static member functions.
  39.  *
  40.  * In KDE 2 and KDE 3, communication with the windowmanager is done with the
  41.  * NET-protocol, a common window manager specification designed by
  42.  * various authors of X11 window managers (including those of the KDE
  43.  * project).  The full specification can be found at
  44.  * www.freedesktop.org/standards/wm-spec .
  45.  *
  46.  * To access features of the NET-protocol, use the classes NETRootInfo
  47.  * and NETWinInfo.
  48.  *
  49.  * The purpose of this class is to to provide easy access to the
  50.  * most-commonly used NET-features with a simpler, KDEish interface.
  51.  *
  52.  * In addition, it encapsulates KDE functionality not yet provided by
  53.  * the NET hints.  Currently that is invokeContextHelp() and
  54.  * setSystemTrayWindowFor() only.
  55.  *
  56.  * @short Class for interaction with the window manager.
  57.  * @see NET
  58.  * @see NetWinInfo
  59.  * @author Matthias Ettrich (ettrich@kde.org)
  60. */
  61. class KDECORE_EXPORT KWin
  62. {
  63. public:
  64.  
  65.     /**
  66.      * Requests that window @p win is activated.
  67.      *
  68.      * There are two ways how to activate a window, by calling
  69.      * activateWindow() and forceActiveWindow(). Generally,
  70.      * applications shouldn't make attempts to explicitly activate
  71.      * their windows, and instead let the user to activate them.
  72.      * In the special cases where this may be needed, applications
  73.      * should use activateWindow(). Window manager may consider whether
  74.      * this request wouldn't result in focus stealing, which
  75.      * would be obtrusive, and may refuse the request.
  76.      *
  77.      * The usage of forceActiveWindow() is meant only for pagers
  78.      * and similar tools, which represent direct user actions
  79.      * related to window manipulation.
  80.      * Except for rare cases, this request will be always honored,
  81.      * and normal applications are forbidden to use it.
  82.      *
  83.      * In case of problems, consult the KWin README in the kdebase
  84.      * package (kdebase/kwin/README), or ask on the kwin@kde.org
  85.      * mailing list.
  86.      *
  87.      * @param win the id of the window to make active
  88.      * @param time X server timestamp of the user activity that
  89.      *    caused this request
  90.      * @since 3.2
  91.      */
  92.     static void activateWindow( WId win, long time = 0 );
  93.  
  94.     /**
  95.      * Sets window @p win to be the active window. Note that this
  96.      * should be called only in special cases, applications
  97.      * shouldn't force themselves or other windows to be the active
  98.      * window. Generally, this call should used only by pagers
  99.      * and similar tools. See the explanation in description
  100.      * of activateWindow().
  101.      *
  102.      * @param win the id of the window to make active
  103.      * @param time X server timestamp of the user activity that
  104.      *    caused this request
  105.      *
  106.      * @since 3.2
  107.     */
  108.     static void forceActiveWindow( WId win, long time = 0 );
  109.     /**
  110.      * @deprecated Consider using activateWindow(), use forceActiveWindow()
  111.      * only if necessary.
  112.      */
  113.     static void setActiveWindow( WId win ) KDE_DEPRECATED;
  114.  
  115.     /**
  116.      * When application finishes some operation and wants to notify
  117.      * the user about it, it can call demandAttention(). Instead
  118.      * of activating the window, which could be obtrusive, the window
  119.      * will be marked specially as demanding user's attention.
  120.      * See also explanation in description of activateWindow().
  121.      *
  122.      * Note that it's usually better to use KNotifyClient.
  123.      *
  124.      * @since 3.2
  125.      */
  126.     static void demandAttention( WId win, bool set = true );
  127.  
  128.     /**
  129.      * Sets user timestamp @p time on window @p win. The timestamp
  130.      * is expressed as XServer time. If a window
  131.      * is shown with user timestamp older than the time of the last
  132.      * user action, it won't be activated after being shown.
  133.      * The most common case is the special value 0 which means
  134.      * not to activate the window after being shown.
  135.      *
  136.      * @since 3.2
  137.      */
  138.     static void setUserTime( WId win, long time );
  139.  
  140.     /**
  141.      * Invokes interactive context help.
  142.      */
  143.     static void invokeContextHelp();
  144.  
  145.  
  146.     /**
  147.      * Sets the parent window of @p subwindow to be @p mainwindow.
  148.      * This overrides the parent set the usual way as the QWidget parent,
  149.      * but only for the window manager - e.g. stacking order and window grouping
  150.      * will be affected, but features like automatic deletion of children
  151.      * when the parent is deleted are unaffected and normally use
  152.      * the QWidget parent.
  153.      *
  154.      * This function should be used before a dialog is shown for a window
  155.      * that belongs to another application.
  156.      *
  157.      * @since 3.4
  158.      */
  159.     static void setMainWindow( QWidget* subwindow, WId mainwindow );
  160.  
  161.     /**
  162.      * Makes @p trayWin a system tray window for @p forWin.
  163.      *
  164.      * A system tray window serves as an icon replacement. It's
  165.      * displayed inside the panel's system tray.
  166.      * @param trayWin the id of the system tray window
  167.      * @param forWin the id of the window represented by the system
  168.      *        tray window
  169.      */
  170.     static void setSystemTrayWindowFor( WId trayWin, WId forWin );
  171.  
  172.     class WindowInfo;
  173.     class WindowInfoPrivate;
  174.     /**
  175.      * Returns information about window @p win. It is recommended to check
  176.      * whether the returned info is valid by calling the valid() method.
  177.      * @param win the id of the window
  178.      * @param properties all properties that should be retrieved (see NET::Property
  179.      *    enum for details) - passing 0 means all properties. Unlisted properties
  180.      *    cause related information to be invalid in the returned data, but
  181.      *    make this function faster when not all data is needed.
  182.      * @param properties2 additional properties (see NET::Property2 enum). Note that
  183.      *    specifying 0 means no properties, not all.
  184.      * @return the window information
  185.      * @since 3.2
  186.      */
  187.     static WindowInfo windowInfo( WId win, unsigned long properties = 0, unsigned long properties2 = 0 );
  188.  
  189.     /**
  190.      * Returns the WM_TRANSIENT_FOR property for the given window, i.e. the mainwindow
  191.      * for this window.
  192.      *
  193.      * @param window the id of the window
  194.      * @since 3.2
  195.      */
  196.     static WId transientFor( WId window );
  197.  
  198.     /**
  199.      * Returns the leader window for the group the given window is in, if any.
  200.      * @param window the id of the window
  201.      * @since 3.2
  202.      */
  203.     static WId groupLeader( WId window );
  204.  
  205.     /**
  206.      * Returns an icon for window @p win.
  207.      *
  208.      * If  @p width and @p height are specified, the best icon for the requested
  209.      * size is returned.
  210.      *
  211.      * If @p scale is true, the icon is smooth-scaled to have exactly
  212.      * the requested size.
  213.      *
  214.      * @param win the id of the window
  215.      * @param width the desired width, or -1
  216.      * @param height the desired height, or -1
  217.      * @param scale if true the icon will be scaled to the desired size. Otherwise the
  218.      *        icon will not be modified.
  219.      * @return the icon of the window
  220.      */
  221.     static QPixmap icon( WId win, int width = -1, int height = -1, bool scale = false );
  222.  
  223.     /**
  224.      * Masks specifying from which sources to read an icon. They are tried from the best
  225.      * until an icon is found.
  226.      * @li NETWM from property from the window manager specification
  227.      * @li WMHints from WMHints property
  228.      * @li ClassHint load icon after getting name from the classhint
  229.      * @li XApp load the standard X icon (last fallback)
  230.      */
  231.     enum IconSource { NETWM = 1, //!< read from property from the window manager specification
  232.               WMHints = 2, //!< read from WMHints property
  233.               ClassHint = 4, //!< load icon after getting name from the classhint
  234.               XApp = 8 //!<load the standard X icon (last fallback)
  235.     };
  236.     /**
  237.      * @overload
  238.      *
  239.      * Overloaded variant that allows specifying from which sources the icon should be read.
  240.      * You should usually prefer the simpler variant which tries all possibilities to get
  241.      * an icon.
  242.      *
  243.      * @param win the id of the window
  244.      * @param width the desired width, or -1
  245.      * @param height the desired height, or -1
  246.      * @param scale if true the icon will be scaled to the desired size. Otherwise the
  247.      *        icon will not be modified.
  248.      * @param flags OR-ed flags from the IconSource enum
  249.      * @since 3.2
  250.      */
  251.     static QPixmap icon( WId win, int width, int height, bool scale, int flags );
  252.  
  253.     /**
  254.      * Sets an @p icon and a  @p miniIcon on window @p win
  255.      * @param win the id of the window
  256.      * @param icon the new icon
  257.      * @param miniIcon the new mini icon
  258.      */
  259.     static void  setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon );
  260.  
  261.     /**
  262.      * Sets the type of window @p win to @p windowType.
  263.      *
  264.      * @param win the id of the window
  265.      * @param windowType the type of the window (see NET::WindowType)
  266.      */
  267.     static void setType( WId win, NET::WindowType windowType );
  268.  
  269.     /**
  270.      * Sets the state of window @p win to @p state.
  271.      *
  272.      * Possible values are or'ed combinations of NET::Modal,
  273.      * NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded,
  274.      * NET::SkipTaskbar, NET::SkipPager, NET::Hidden,
  275.      * NET::FullScreen, NET::KeepAbove, NET::KeepBelow, NET::StaysOnTop
  276.      *
  277.      * @param win the id of the window
  278.      * @param state the new flags that will be set
  279.      */
  280.     static void setState( WId win, unsigned long state );
  281.  
  282.     /**
  283.      * Clears the state of window @p win from @p state.
  284.      *
  285.      * Possible values are or'ed combinations of NET::Modal,
  286.      * NET::Sticky, NET::MaxVert, NET::MaxHoriz, NET::Shaded,
  287.      * NET::SkipTaskbar, NET::SkipPager, NET::Hidden,
  288.      * NET::FullScreen, NET::KeepAbove, NET::KeepBelow, NET::StaysOnTop
  289.      *
  290.      * @param win the id of the window
  291.      * @param state the flags that will be cleared
  292.      */
  293.     static void clearState( WId win, unsigned long  state );
  294.     
  295.     /**
  296.      * Sets the opacity of window @p win to percetage @p percent.
  297.      *
  298.      * Convenience function that just sets an X property
  299.      * needs a running composite manager for any visible effect
  300.      *
  301.      * @param win the id of the window
  302.      * @param percent the opacity value in percent (will be justified to [ 0: transparent - 100: opaque ])
  303.      * @since 3.4
  304.      */
  305.     static void setOpacity( WId win, uint percent );
  306.     
  307.     /**
  308.      * Sets the shadowsize of window @p win to percetage @p percent.
  309.      *
  310.      * Convenience function that just sets an X property
  311.      * needs the running KDE kompmgr manager for any visible effect
  312.      *
  313.      * @param win the id of the window
  314.      * @param percent the opacity value in percent (0 leads to a completely unshadowed window)
  315.      * @since 3.4
  316.      */
  317.     static void setShadowSize( WId win, uint percent );
  318.  
  319.     /**
  320.      * Sets window @p win to be present on all virtual desktops if @p
  321.      * is true. Otherwise the window lives only on one single desktop.
  322.      *
  323.      * @param win the id of the window
  324.      * @param b true to show the window on all desktops, false
  325.      *          otherwise
  326.      */
  327.     static void setOnAllDesktops( WId win, bool b );
  328.  
  329.     /**
  330.      * Moves window @p win to desktop @p desktop.
  331.      *
  332.      * @param win the id of the window
  333.      * @param desktop the number of the new desktop
  334.      */
  335.     static void setOnDesktop( WId win, int desktop);
  336.  
  337.     /**
  338.      * Sets the strut of window @p win to @p to @p left width
  339.      * ranging from @p left_start to @p left_end on the left edge,
  340.      * and simiarly for the other edges. For not reserving a strut, pass 0 as the width.
  341.      * E.g. to reserve 10x10 square in the topleft corner, use e.g.
  342.      * setExtendedStrut( w, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 ).
  343.      *
  344.      * @param win the id of the window
  345.      * @param left_width width of the strut at the left edge
  346.      * @param left_start starting y coordinate of the strut at the left edge
  347.      * @param left_end ending y coordinate of the strut at the left edge
  348.      * @param right_width width of the strut at the right edge
  349.      * @param right_start starting y coordinate of the strut at the right edge
  350.      * @param right_end ending y coordinate of the strut at the right edge
  351.      * @param top_width width of the strut at the top edge
  352.      * @param top_start starting x coordinate of the strut at the top edge
  353.      * @param top_end ending x coordinate of the strut at the top edge
  354.      * @param bottom_width width of the strut at the bottom edge
  355.      * @param bottom_start starting x coordinate of the strut at the bottom edge
  356.      * @param bottom_end ending x coordinate of the strut at the bottom edge
  357.      */
  358.     static void setExtendedStrut( WId win, int left_width, int left_start, int left_end,
  359.         int right_width, int right_start, int right_end, int top_width, int top_start, int top_end,
  360.         int bottom_width, int bottom_start, int bottom_end );
  361.  
  362.     /**
  363.      * @deprecated use setExtendedStrut()
  364.      * Sets the strut of window @p win to @p left, @p right, @p top, @p bottom.
  365.      *
  366.      * @param win the id of the window
  367.      * @param left the left strut
  368.      * @param right the right strut
  369.      * @param top the top strut
  370.      * @param bottom the bottom strut
  371.      */
  372.     static void setStrut( WId win, int left, int right, int top, int bottom );
  373.     /**
  374.      * Convenience function to access the current desktop.  See NETRootInfo.
  375.      * @return the number of the current desktop
  376.      */
  377.     static int currentDesktop();
  378.  
  379.     /**
  380.      * Convenience function to access the number of desktops. See
  381.      * NETRootInfo.
  382.      * @return the number of desktops
  383.      */
  384.     static int numberOfDesktops();
  385.  
  386.     /**
  387.      * Convenience function to set the current desktop to @p desktop.
  388.      * See NETRootInfo.
  389.      * @param desktop the number of the new desktop
  390.      */
  391.     static void setCurrentDesktop( int desktop );
  392.  
  393.     /**
  394.      * Convenience function to set the current viewport to @p viewport.
  395.      * See NETRootInfo.
  396.      * @param desktop the number of the new desktop
  397.      * @param viewport the position of the new viewport
  398.      * @since 3.5.5
  399.      */
  400.     static void setCurrentDesktopViewport( int desktop, QPoint viewport );
  401.  
  402.     /**
  403.      * Iconifies a window. Compatible to XIconifyWindow but has an
  404.      * additional parameter @p animation.
  405.      *
  406.      * @param win the id of the window
  407.      * @param animation true to show an animation
  408.      * @see deIconifyWindow()
  409.      */
  410.     static void iconifyWindow( WId win, bool animation = true  );
  411.  
  412.     /**
  413.      * DeIconifies a window. Compatible to XMapWindow but has an
  414.      * additional parameter @p animation.
  415.      *
  416.      * @param win the id of the window
  417.      * @param animation true to show an animation
  418.      * @see iconifyWindow()
  419.      */
  420.     static void deIconifyWindow( WId win, bool animation = true );
  421.  
  422.     /**
  423.      * Raises the given window. This call is only for pagers and similar
  424.      * tools that represent direct user actions. Applications should not
  425.      * use it, they should keep using QWidget::raise() or XRaiseWindow()
  426.      * if necessary.
  427.      * @since 3.2
  428.      */
  429.     static void raiseWindow( WId win );
  430.  
  431.     /**
  432.      * Lowers the given window. This call is only for pagers and similar
  433.      * tools that represent direct user actions. Applications should not
  434.      * use it, they should keep using QWidget::lower() or XLowerWindow()
  435.      * if necessary.
  436.      * @since 3.2
  437.      */
  438.     static void lowerWindow( WId win );
  439.  
  440.     /**
  441.      * @internal
  442.      * Returns true if the WM uses IconicState also for windows
  443.      * on inactive virtual desktops.
  444.      */
  445.     static bool icccmCompliantMappingState();
  446.  
  447.     /**
  448.      * Returns true if the WM announces which actions it allows for windows.
  449.      * @since 3.2
  450.      */
  451.     static bool allowedActionsSupported();
  452.  
  453.     /**
  454.      * Function that reads and returns the contents of the given text
  455.      * property (WM_NAME, WM_ICON_NAME,...).
  456.      * @since 3.2
  457.      */
  458.     static QString readNameProperty( WId window, unsigned long atom );
  459.  
  460.     /**
  461.      * Returns true if a compositing manager is running (i.e. ARGB windows
  462.      * are supported, effects will be provided, etc.).
  463.      */
  464.     static bool compositingActive();
  465.  
  466.     /**
  467.      * @deprecated Use WindowInfo .
  468.      */
  469.     struct KDECORE_EXPORT Info
  470.     {
  471.       /// The window's id.
  472.     WId win;
  473.       /// The window's state.
  474.      long unsigned int state;
  475.       /// The mapping state.
  476.     bool isMinimized() const;
  477.     bool isIconified() const;
  478.     NET::MappingState mappingState;
  479.       /// The strut.
  480.     NETStrut strut;
  481.       /// The window type.
  482.     NET::WindowType windowType;
  483.       /// The visible name of the window.
  484.     QString visibleName;
  485.       /// The name of the window.
  486.     QString name;
  487.       /// The number of the window's desktop.
  488.     int desktop;
  489.       /// true if the window is on all desktops.
  490.     bool onAllDesktops;
  491.       /// The process id of the window's owner
  492.     pid_t pid;
  493.       /// Position and size of the window contents.
  494.     QRect geometry;
  495.       /// Position and size of the window's frame.
  496.     QRect frameGeometry;
  497.  
  498.     QString visibleNameWithState() const;
  499.     };
  500.  
  501.     /**
  502.      * @deprecated
  503.      * Use windowInfo() .
  504.      */
  505.     static Info info( WId win ) KDE_DEPRECATED;
  506.  
  507. #ifdef KDE_NO_COMPAT
  508. private:
  509. #endif
  510.     /**
  511.      * @deprecated
  512.      * Use KStartupInfo::appStarted
  513.      */
  514.     static void appStarted() KDE_DEPRECATED;
  515. };
  516.  
  517.  
  518. /**
  519.  * Information about a window.
  520.  * @since 3.2
  521.  */
  522. class KDECORE_EXPORT KWin::WindowInfo
  523. {
  524. public:
  525.     /**
  526.      * Reads all the info about the given window.
  527.      */
  528.     WindowInfo( WId window, unsigned long properties, unsigned long properties2 );
  529.     WindowInfo(); // to make QValueList and others happy
  530.     ~WindowInfo();
  531.     /**
  532.      * Returns false if this window info is not valid (most probably the given
  533.      * window doesn't exist).
  534.      * @param withdrawn_is_valid if true, windows in the withdrawn state
  535.      *        (i.e. not managed) are also considered. This is usually not the case.
  536.      */
  537.     bool valid( bool withdrawn_is_valid = false ) const;
  538.     /**
  539.      * Returns the window identifier.
  540.      */
  541.     WId win() const;
  542.     /**
  543.      * Returns the window's state flags (see the NET::State enum for details).
  544.      * Requires NET::WMState passed to KWin::windowInfo().
  545.      */
  546.     unsigned long state() const;
  547.     /**
  548.      * Returns true if the window has the given state flag set (see the NET::State enum for details).
  549.      * Requires NET::WMState passed to KWin::windowInfo().
  550.      * @since 3.2.1
  551.      */
  552.     bool hasState( unsigned long s ) const { return ( state() & s ) == s; }
  553.     /**
  554.      * Returns true if the window is minimized. Note that it is true only if
  555.      * the window is truly minimized, not shaded or on another virtual desktops,
  556.      * which makes it different from mappingState() == NET::Iconic
  557.      * or QWidget::isMinimized().
  558.      * Requires NET::WMState and NET::XAWMState passed to KWin::windowInfo().
  559.      */
  560.     bool isMinimized() const;
  561.     /**
  562.      * Returns the mapping state of the window (see NET::MappingState). Note that
  563.      * it's very likely that you don't want to use this function, and use isOnDesktop(),
  564.      * isMinimized() etc. instead.
  565.      * Requires NET::XAWMState passed to KWin::windowInfo().
  566.      */
  567.     NET::MappingState mappingState() const;
  568.     /**
  569.      * Returns the window extended (partial) strut.
  570.      * Requires NET::WM2ExtendedStrut passed to KWin::windowInfo().
  571.      */
  572.     NETExtendedStrut extendedStrut() const;
  573.     /**
  574.      * @deprecated use extendedStrut()
  575.      * Returns the window strut.
  576.      * Requires NET::WMStrut passed to KWin::windowInfo().
  577.      */
  578.     NETStrut strut() const;
  579.     /**
  580.      * Returns the window type of this window (see NET::WindowType). The argument
  581.      * should be all window types your application supports (see NET::WindowTypeMask).
  582.      * Requires NET::WMWindowType passed to KWin::windowInfo().
  583.      */
  584.     NET::WindowType windowType( int supported_types ) const;
  585.     /**
  586.      * Returns the visible name of the window (i.e. including possible <2> appended
  587.      * when there are two or more windows with the same name).
  588.      * Requires NET::WMVisibleName passed to KWin::windowInfo().
  589.      */
  590.     QString visibleName() const;
  591.     /**
  592.      * Returns a visible name with state.
  593.      *
  594.      * This is a simple convenience function that returns the
  595.      * visible name but with parentheses around minimized windows.
  596.      * Requires NET::WMVisibleName, NET::WMState and NET::XAWMState passed
  597.      * to KWin::windowInfo().
  598.      * @return the window name with state
  599.      */
  600.     QString visibleNameWithState() const;
  601.     /**
  602.      * Returns the name of the window, as specified by the application, without
  603.      * any modifications. You should often use visibleName() instead.
  604.      * Requires NET::WMName passed to KWin::windowInfo().
  605.      */
  606.     QString name() const;
  607.     /**
  608.      * Returns the visible name of the window that should be shown in taskbar
  609.      * and all other "iconic" representations of the window. Note that this
  610.      * has nothing to do with normal icons.
  611.      * Requires NET::WMVisibleIconName passed to KWin::windowInfo().
  612.      */
  613.     QString visibleIconName() const;
  614.     /**
  615.      * Returns a visible name with state.
  616.      *
  617.      * This is a simple convenience function that returns the
  618.      * visible iconic name but with parentheses around minimized windows.
  619.      * Note that this has nothing to do with normal icons.
  620.      * Requires NET::WMVisibleIconName, NET::WMState and NET::XAWMState passed
  621.      * to KWin::windowInfo().
  622.      * @return the window iconic name with state
  623.      */
  624.     QString visibleIconNameWithState() const;
  625.     /**
  626.      * Returns the name of the window that should be shown in taskbar and all other
  627.      * "iconic" representations of the window. Note that this has nothing to do
  628.      * with normal icons.
  629.      * Requires NET::WMIconName passed to KWin::windowInfo().
  630.      */
  631.     QString iconName() const;
  632.     /**
  633.      * Returns true if the window is on the currently active virtual desktop.
  634.      * Requires NET::WMDesktop passed to KWin::windowInfo().
  635.      */
  636.     bool isOnCurrentDesktop() const;
  637.     /**
  638.      * Returns true if the window is on the given virtual desktop.
  639.      * Requires NET::WMDesktop passed to KWin::windowInfo().
  640.      */
  641.     bool isOnDesktop( int desktop ) const;
  642.     /**
  643.      * Returns true if the window is on all desktops
  644.      * (equal to desktop()==NET::OnAllDesktops).
  645.      * Requires NET::WMDesktop passed to KWin::windowInfo().
  646.      */
  647.     bool onAllDesktops() const;
  648.     /**
  649.      * Returns the virtual desktop this window is on (NET::OnAllDesktops if the window
  650.      * is on all desktops). You should prefer using isOnDesktop().
  651.      * Requires NET::WMDesktop passed to KWin::windowInfo().
  652.      */
  653.     int desktop() const;
  654.     /**
  655.      * Returns the position and size of the window contents.
  656.      * Requires NET::WMGeometry passed to KWin::windowInfo().
  657.      */
  658.     QRect geometry() const;
  659.     /**
  660.      * Returns the frame geometry of the window, i.e. including the window decoration.
  661.      * Requires NET::WMKDEFrameStrut passed to KWin::windowInfo().
  662.      */
  663.     QRect frameGeometry() const;
  664.     /**
  665.      * Returns the WM_TRANSIENT_FOR property for the window, i.e. the mainwindow
  666.      * for this window.
  667.      * Requires NET::WM2TransientFor passed to KWin::windowInfo().
  668.      */
  669.     WId transientFor() const;
  670.     /**
  671.      * Returns the leader window for the group the window is in, if any.
  672.      * Requires NET::WM2GroupLeader passed to KWin::windowInfo().
  673.      */
  674.     WId groupLeader() const;
  675.  
  676.     /**
  677.      * Returns the class component of the window class for the window
  678.      * (i.e. WM_CLASS property).
  679.      * Requires NET::WM2WindowClass passed to KWin::windowInfo().
  680.      * @since 3.3
  681.      */
  682.     QCString windowClassClass() const;
  683.  
  684.     /**
  685.      * Returns the name component of the window class for the window
  686.      * (i.e. WM_CLASS property).
  687.      * Requires NET::WM2WindowClass passed to KWin::windowInfo().
  688.      * @since 3.3
  689.      */
  690.     QCString windowClassName() const;
  691.  
  692.     /**
  693.      * Returns the window role for the window (i.e. WM_WINDOW_ROLE property).
  694.      * Requires NET::WM2WindowRole passed to KWin::windowInfo().
  695.      * @since 3.3
  696.      */
  697.     QCString windowRole() const;
  698.  
  699.     /**
  700.      * Returns the client machine for the window (i.e. WM_CLIENT_MACHINE property).
  701.      * Requires NET::WMClientMachine passed to KWin::windowInfo().
  702.      * @since 3.3
  703.      */
  704.     QCString clientMachine() const;
  705.  
  706.     /**
  707.      * Returns true if the given action is currently supported for the window
  708.      * by the window manager.
  709.      * Requires NET::WM2AllowedActions passed to KWin::windowInfo().
  710.      */
  711.     bool actionSupported( NET::Action action ) const;
  712.  
  713.     WindowInfo( const WindowInfo& );
  714.     WindowInfo& operator=( const WindowInfo& );
  715. private:
  716.     WindowInfoPrivate* d;
  717. };
  718.  
  719. #endif //Q_OS_UNIX
  720.  
  721. #endif
  722.